package com.yvdedu.hospital.service.impl;

import java.util.List;
import javax.annotation.Resource;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.yvdedu.hospital.entity.Department;
import com.yvdedu.hospital.entity.Drug;
import com.yvdedu.hospital.entity.Drug_type;
import com.yvdedu.hospital.entity.Su;
import com.yvdedu.hospital.entity.Supply_unit;
import com.yvdedu.hospital.entity.Used;
import com.yvdedu.hospital.entity.User;
import com.yvdedu.hospital.mapper.DepotDailyMapper;
import com.yvdedu.hospital.service.DepotDailyService;

@Service
public class DepotDailySer implements DepotDailyService {

	
	@Resource
	DepotDailyMapper depotDailyMapper;

	@Override
	public List<Drug> query(int pageNumber) {
//		PageHelper.startPage(pageNumber,10);
		PageHelper.startPage(pageNumber,15);
		List<Drug> list = depotDailyMapper.query();
		return list;
	}

	@Override
	public void addsum(Su su) {
		depotDailyMapper.addsum(su);
	}

	@Override
	public List<Su> suquery(int pageNumber) {
//		System.out.println("查询");
		PageHelper.startPage(pageNumber,15);
		List<Su> list = depotDailyMapper.suqurey();
		return list;
	}

	@Override
	public void delesum(int id) {
		depotDailyMapper.delesum(id);
	}
	
	@Override
	public List<User> departmentQuery(int Role_id) {
		
		List<User> list=depotDailyMapper.departmentQuery(Role_id);
		return list;
		
	}
	
	@Override
	public List<Department> AQuery(Department department) {
		List<Department> list=depotDailyMapper.AQuery();
		return list;
		
	}
	
	@Override
	public List<Drug> drugQuery(int pageNumber) {
		PageHelper.startPage(pageNumber,10);
		List<Drug> list=depotDailyMapper.drugQuery();
		return list;
		
	}

	
	@Override
	public List<Drug> IdQuery(int id) {
		List<Drug> list=depotDailyMapper.IdQuery(id);
		return list;
		
	}
	@Override
	public List<Drug> DateQuery(String yx_date) {
		List<Drug> list=depotDailyMapper.DateQuery(yx_date);
		return list;
		
	}
	
	@Override
	public List<Drug> DateMax_DateMinx(@Param("sc_date") String sc_date,@Param("yx_date") String yx_date,@Param("name") String name) {
		List<Drug> list=depotDailyMapper.DateMax_DateMinx(sc_date,yx_date,name);
		return list;
		
	}
	
	@Override
	public List<Used> CommonYao(int pageNumber) {
		PageHelper.startPage(pageNumber,5);
		List<Used> list=depotDailyMapper.CommonYao();
		return list;
		
	}
	@Override
	public List<Used> CommonYao_data(@Param("sc_date") String sc_date,@Param("yx_date") String yx_date,@Param("name") String name) {
		List<Used> list=depotDailyMapper.CommonYao_data(sc_date,yx_date,name);
		return list;
		
	}
	@Override
	public List<Drug_type> hz_Query(int pageNumber) {
		PageHelper.startPage(pageNumber,5);
		List<Drug_type> list=depotDailyMapper.hz_Query();
		return list;
		
	}
	
	@Override
	public List<Drug_type> yp_typesum_search(@Param("sc_date") String sc_date,@Param("yx_date") String yx_date,@Param("name") String name,@Param("yao_name") String yao_name) {
		List<Drug_type> list=depotDailyMapper.yp_typesum_search(sc_date, yx_date, name,yao_name);
		return list;
		
	}
	@Override
	public List<Drug> xg_search(int id) {
		List<Drug> list=depotDailyMapper.xg_search(id);
		return list;
		
	}
//	@Override
//	public List<Drug> yao_update(@Param("yao_upper") String yao_upper,@Param("lower_upper") String lower_upper,@Param("mf") String mf,@Param("new_yao") String new_yao,@Param("state") String state,@Param("id") int id) {
//		List<Drug> list=depotDailyMapper.yao_update(yao_upper,lower_upper,mf,new_yao,state,id);
//		return list;
//		
//	}
	
	@Override
	public int yao_update(Drug drug) {
		int list=depotDailyMapper.yao_update(drug);
		return list;
		
	}
	
	@Override
	public List<Drug> yp_rk_cx(String name) {
		List<Drug> list=depotDailyMapper.yp_rk_cx(name);
		return list;
		
	}
	
	@Override
	public List<Supply_unit> Supply_unit_search() {
		List<Supply_unit> list=depotDailyMapper.Supply_unit_search();
		return list;
		
	}
	@Override
	public void add_Storage(Drug drug) {
		depotDailyMapper.add_Storage(drug);
	}
	
	@Override
	public List<Drug> rkxz() {
		List<Drug> list=depotDailyMapper.rkxz();
		return list;
		
	}
	
	@Override
	public int sc(int id) {
		depotDailyMapper.sc(id);
		return id;
	}
	
	@Override
	public List<Supply_unit> Supply_unit_cx(String name) {
		List<Supply_unit> list=depotDailyMapper.Supply_unit_cx(name);
		return list;
		
	}
	@Override
	public int Supply_unit_sc(int id) {
		depotDailyMapper.Supply_unit_sc(id);
		return id;
	}
	@Override
	public int drug_sc(int id) {
		depotDailyMapper.drug_sc(id);
		return id;
	}
	
	@Override
	public void add_Supply_unit(Supply_unit supply_unit) {
		depotDailyMapper.add_Supply_unit(supply_unit);
	}
	
	@Override
	public void batchDeleteUser(List ids) {
		depotDailyMapper.batchDeleteUser(ids);
			
	}
	@Override
	public List<Drug> fp_cx(@Param("fpnumber") int fpnumber,@Param("sh") String sh) {
		List<Drug> list=depotDailyMapper.fp_cx(fpnumber,sh);
		return list;
		
	}
	
	@Override
	public void dt_batchDeleteUser(List ids) {
		depotDailyMapper.dt_batchDeleteUser(ids);
			
	}
	
	@Override
	public void zt_update(List ids,@Param("sh_name") String sh_name,@Param("sh_date") String sh_date) {
		depotDailyMapper.zt_update(ids,sh_name,sh_date);
		//System.out.println("idlist"+ids+"名字"+sh_name);
		
			
	}
	
}
